FROM ubuntu:20.04
MAINTAINER wanghao wanghaosq@gmail.com
WORKDIR /app
COPY helios-server ./helios-server
RUN apt-get update \
    && apt-get install -y sudo \
    && sudo apt-get install -y software-properties-common \
    && sudo add-apt-repository ppa:deadsnakes/ppa -y \
    && sudo apt update \
    && sudo apt-get install -y rabbitmq-server \
	postgresql \
	python3.6 \
	python3.6-dev \
	python3.6-venv \
        python3-pip \
	libpq-dev \
        tcl \
        expect \
        python-celery-common

#RUN #cd helios-server \
    #&& python3.6 -m venv venv \
    #&& /bin/bash -c "source /app/helios-server/venv/bin/activate" \
    #&& python3.6 -m pip install -r requirements.txt --quiet
    #&& ls /etc/init.d/ \
    #&& /etc/init.d/postgresql start\
    #&& /etc/init.d/rabbitmq-server start \
    #&& ./reset.sh \
    #&& celery -A helios worker -l INFO
COPY helios-server/start_service.sh /usr/bin/start_service.sh
RUN cat -n helios-server/start_service.sh \
    && chmod +x /usr/bin/start_service.sh 
#CMD ["python manage.py runserver 0.0.0.0:8000"]
EXPOSE 8000
CMD ["start_service.sh"]
#ENTRYPOINT ["/bin/bash", "-c", "./app/helios-server/start_service.sh"]
#ENTRYPOINT ["./setup.sh"]
